You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure this should be the solution (see below). TLDR: we can use it as it is but at least we should add a warning.
Surely, this will avoid the exception from being raised but the OpenTracing API seems to permit having negative span durations. The duration of a span is the difference between its start_time and its finish_time. Since both start_time and finish_time can be passed down as arguments, this means that whoever calls these methods could use a combination that causes span.duration to be negative if that is desired. Even when I have no practical reason on who may want this to happen, this certainly could.
This does not seem to be the place to check for negative durations, the place where span.duration is set seems more likely. I have tried the code in util._time_to_micros and it seems to handle negative values well, so the exception reported in #77 should be happening in the call to Span (which is in lightstep.collector_pb2.py which is not Python code currently). So, since the problem can't be tracked down more, I would suggest to at least raise a warning, since the most likely situation is the one reported in #77, and probably the end user would at least like to know this is happening.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should fix #77